home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 9 / Night Owl CD-ROM (NOPV9) (Night Owl Publisher) (1993).ISO / 001a / dsemp481.zip / DSEMP481
Text File  |  1993-02-19  |  35KB  |  1,316 lines

  1. diff +context dosemu0.48/Makefile dosemu0.48p1/Makefile
  2. *** dosemu0.48/Makefile    Thu Feb 18 19:28:04 1993
  3. --- dosemu0.48p1/Makefile    Thu Feb 18 19:23:07 1993
  4. ***************
  5. *** 12,17 ****
  6. --- 12,21 ----
  7.   # just do "make disks" then a "make all" (or "make install") to rebuild
  8.   # the emulator after changing the FLOPPY_CONFIG variable.
  9.   
  10. + # DON'T CHANGE THIS: this makes libemu start high enough to be safe. should be 
  11. + # okay at...0x10000000 for 1 GB mark.  nobody should ever use 1 GB on a PC.
  12. + LIBSTART = 0x10000000
  13.   # path to your compiler's shared libraries
  14.   #
  15.   # IF YOU ARE NOT USING GCC 2.3.3, ENSURE THAT THE FOLLOWING LINE
  16. ***************
  17. *** 33,39 ****
  18.   #
  19.   # VIDEO_CARD
  20.   #    choose the correct one for your machine.
  21. ! #    currently, VGA/EGA/CGA are synonomous
  22.   #
  23.   
  24.     VIDEO_CARD = -DVGA_VIDEO
  25. --- 37,44 ----
  26.   #
  27.   # VIDEO_CARD
  28.   #    choose the correct one for your machine.
  29. ! #    currently, VGA/EGA/CGA are synonomous, and MDA is untested :-)
  30. ! #    I'd like to hear if it works for you (gt8134b@prism.gatech.edu)
  31.   #
  32.   
  33.     VIDEO_CARD = -DVGA_VIDEO
  34. ***************
  35. *** 45,51 ****
  36.   
  37.   # KEYBOARD
  38.   #   choose the proper RAW-mode keyboard
  39. ! #   nationality 
  40.   #
  41.   
  42.     KEYBOARD = -DKBD_US -DKBDFLAGS=0
  43. --- 50,57 ----
  44.   
  45.   # KEYBOARD
  46.   #   choose the proper RAW-mode keyboard
  47. ! #   nationality...foreign keyboards are probably not
  48. ! #   well-supported because of lack of dead-key/diacritical code
  49.   #
  50.   
  51.     KEYBOARD = -DKBD_US -DKBDFLAGS=0
  52. ***************
  53. *** 68,76 ****
  54.   
  55.   
  56.   # DISKS
  57. - #   choose fron one of the standard configs,
  58. - #   or put together one of your own.  Leave
  59. - #   only one FLOPPY_CONFIG line uncommented!
  60.   #
  61.   # these are the DEFault numbers of disks
  62.   # note that LINUX.EXE will fail if there are more than two
  63. --- 74,79 ----
  64. ***************
  65. *** 144,155 ****
  66.   #
  67.   XMS     = -DXMS=1
  68.   XMSOBS  = xms.o
  69. ! MAX_XMS = 3072
  70.   
  71.   #
  72.   # SYNC_ALOT
  73. ! #  uncomment this if the emulator is crashing and some debug info isn't
  74. ! #  being written to the file
  75.   # SYNC_ALOT = -DSYNC_ALOT=1
  76.   
  77.   
  78. --- 147,158 ----
  79.   #
  80.   XMS     = -DXMS=1
  81.   XMSOBS  = xms.o
  82. ! MAX_XMS = 4096        # max 4 megs XMS
  83.   
  84.   #
  85.   # SYNC_ALOT
  86. ! #  uncomment this if the emulator is crashing your machine and some debug info
  87. ! # isn't being sync'd to the debug file (stdout). shouldn't happen. :-)
  88.   # SYNC_ALOT = -DSYNC_ALOT=1
  89.   
  90.   
  91. ***************
  92. *** 167,181 ****
  93.   CONFIGS   = $(KEYBOARD) $(PHANTOMDIR) $(VIDEO_CARD) $(MATHCO)
  94.   DEBUG     = $(SYNC_ALOT)
  95.   DISKS     = $(NUM_DISKS) $(FLOPPY_CONFIG)
  96. ! CFLAGS    = $(DEFINES) $(CONFIGS) $(OPTIONAL) $(DEBUG) $(DISKS) #-O6 -Wall
  97.   
  98.   all:    dos libemu
  99.   
  100. ! dos:    dos.c
  101. !     $(CC) -N -o $@ $<
  102.   
  103.   libemu:    $(OBJS)
  104. !     ld -T 400000 -o $@ $(OBJS) $(SHLIBS) -lc -ltermcap
  105.   
  106.   clean:
  107.       rm -f $(OBJS) $(GFXOBS) $(XMSOBS) dos libemu *.s core
  108. --- 170,185 ----
  109.   CONFIGS   = $(KEYBOARD) $(PHANTOMDIR) $(VIDEO_CARD) $(MATHCO)
  110.   DEBUG     = $(SYNC_ALOT)
  111.   DISKS     = $(NUM_DISKS) $(FLOPPY_CONFIG)
  112. ! CFLAGS    = $(DEFINES) $(CONFIGS) $(OPTIONAL) $(DEBUG) $(DISKS) \
  113. !         -DLIBSTART=$(LIBSTART) # -O6 -Wall
  114.   
  115.   all:    dos libemu
  116.   
  117. ! dos:    dos.c Makefile
  118. !     $(CC) -N -DLIBSTART=$(LIBSTART) -o $@ $<
  119.   
  120.   libemu:    $(OBJS)
  121. !     ld -T $(LIBSTART) -o $@ $(OBJS) $(SHLIBS) -lc -ltermcap
  122.   
  123.   clean:
  124.       rm -f $(OBJS) $(GFXOBS) $(XMSOBS) dos libemu *.s core
  125. ***************
  126. *** 201,207 ****
  127.       @echo "FINAL TAR.Z FILE:"
  128.       @ls -l /tmp/dosemu0.48.tar.Z
  129.   
  130. ! emu.o:        emu.h dosvga.h xms.h timers.h Makefile
  131.   linuxfs.o:    emu.h 
  132.   termio.o:    emu.h termio.h dosvga.h
  133.   disks.o:    emu.h Makefile
  134. --- 205,211 ----
  135.       @echo "FINAL TAR.Z FILE:"
  136.       @ls -l /tmp/dosemu0.48.tar.Z
  137.   
  138. ! emu.o:        emu.h dosvga.h xms.h timers.h cmos.h Makefile
  139.   linuxfs.o:    emu.h 
  140.   termio.o:    emu.h termio.h dosvga.h
  141.   disks.o:    emu.h Makefile
  142. ***************
  143. *** 209,212 ****
  144.   dosvga.o:    emu.h dosvga.h
  145.   xms.o:        emu.h xms.h Makefile
  146.   timers.o:    emu.h timers.h
  147. ! cmos.o:        emu.h cmos.h
  148. --- 213,216 ----
  149.   dosvga.o:    emu.h dosvga.h
  150.   xms.o:        emu.h xms.h Makefile
  151.   timers.o:    emu.h timers.h
  152. ! cmos.o:        emu.h cmos.h Makefile
  153. diff +context dosemu0.48/README dosemu0.48p1/README
  154. *** dosemu0.48/README    Thu Feb 18 19:28:04 1993
  155. --- dosemu0.48p1/README    Thu Feb 18 19:12:15 1993
  156. ***************
  157. *** 88,90 ****
  158. --- 88,91 ----
  159.   (This address was often unreachable, and Matthias seems to have left
  160.    the university.  He seems to have no net access now.
  161.    -Robert)
  162. diff +context dosemu0.48/README.first dosemu0.48p1/README.first
  163. *** dosemu0.48/README.first    Thu Feb 18 19:28:04 1993
  164. --- dosemu0.48p1/README.first    Thu Feb 18 19:12:15 1993
  165. ***************
  166. *** 1,6 ****
  167.   ========================== DOS EMULATOR 0.48 ===========================
  168.         Robert Sanders                           gt8134b@prism.gatech.edu
  169. ! $Header: /usr/src/dos/RCS/README.first,v 1.4 1993/02/16 00:21:29 root Exp $
  170.   ========================================================================
  171.   
  172.                           January  27, 1993  0.47
  173. --- 1,6 ----
  174.   ========================== DOS EMULATOR 0.48 ===========================
  175.         Robert Sanders                           gt8134b@prism.gatech.edu
  176. ! $Header: /usr/src/dos/RCS/README.first,v 1.5 1993/02/18 18:53:41 root Exp $
  177.   ========================================================================
  178.   
  179.                           January  27, 1993  0.47
  180. ***************
  181. *** 467,474 ****
  182.   problems that you find.  They are more helpful to me than descriptions
  183.   alone.
  184.   
  185. ! DR-DOS 6.0 apparently works under the emulator now.  If you have any
  186. ! problems, write me.
  187.   
  188.   People have had some success using Stacker and SuperStor to access
  189.   their compressed "partitions" under the emulator.  I don't have either
  190. --- 467,475 ----
  191.   problems that you find.  They are more helpful to me than descriptions
  192.   alone.
  193.   
  194. ! DR-DOS 6.0 apparently works under the emulator now.  I have been told that,
  195. ! because it uses a variety of temporary files, your boot disk (whataver it
  196. ! may be) should be un-write-protected. If you have any problems, write me.
  197.   
  198.   People have had some success using Stacker and SuperStor to access
  199.   their compressed "partitions" under the emulator.  I don't have either
  200. ***************
  201. *** 484,490 ****
  202.   Here are some programs that are reported to work:
  203.     DR-DOS 6.0, SuperStor, Stacker, uEmacs (don't even think about demacs!),
  204.     Minitab, the Big Mouth Voicemail card (Ed Carp, erc@apple.com posted
  205. !   some patches to get it to work)
  206.   
  207.   Things that almost work:
  208.     Currently, I'm trying to coax QBASIC/EDIT into working. They do
  209. --- 485,491 ----
  210.   Here are some programs that are reported to work:
  211.     DR-DOS 6.0, SuperStor, Stacker, uEmacs (don't even think about demacs!),
  212.     Minitab, the Big Mouth Voicemail card (Ed Carp, erc@apple.com posted
  213. !   some patches to get it to work), Managing Your Money
  214.   
  215.   Things that almost work:
  216.     Currently, I'm trying to coax QBASIC/EDIT into working. They do
  217. ***************
  218. *** 586,590 ****
  219. --- 587,592 ----
  220.   
  221.   Robert Sanders
  222.   gt8134b@prism.gatech.edu
  223.   
  224.   
  225. diff +context dosemu0.48/cmos.c dosemu0.48p1/cmos.c
  226. *** dosemu0.48/cmos.c    Thu Feb 18 19:28:04 1993
  227. --- dosemu0.48p1/cmos.c    Thu Feb 18 19:12:14 1993
  228. ***************
  229. *** 1,9 ****
  230.   /* cmos.c, for DOSEMU
  231.    *   by Robert Sanders, gt8134b@prism.gatech.edu
  232.    *
  233. !  * $Date: 1993/02/16 00:21:29 $ 
  234.    * $Source: /usr/src/dos/RCS/cmos.c,v $
  235. !  * $Revision: 1.2 $
  236.    * $State: Exp $
  237.    */
  238.   
  239. --- 1,9 ----
  240.   /* cmos.c, for DOSEMU
  241.    *   by Robert Sanders, gt8134b@prism.gatech.edu
  242.    *
  243. !  * $Date: 1993/02/16 19:49:06 $ 
  244.    * $Source: /usr/src/dos/RCS/cmos.c,v $
  245. !  * $Revision: 1.3 $
  246.    * $State: Exp $
  247.    */
  248.   
  249. ***************
  250. *** 69,75 ****
  251.     cmos.subst[0x33] = 0xe1;
  252.     cmos.flag[0x33] = 1;
  253.   
  254. !   warn("CMOS initialized: \n$Header: /usr/src/dos/RCS/cmos.c,v 1.2 1993/02/16 00:21:29 root Exp $\n");
  255.   }
  256.   
  257.   
  258. --- 69,75 ----
  259.     cmos.subst[0x33] = 0xe1;
  260.     cmos.flag[0x33] = 1;
  261.   
  262. !   warn("CMOS initialized: \n$Header: /usr/src/dos/RCS/cmos.c,v 1.3 1993/02/16 19:49:06 root Exp $\n");
  263.   }
  264.   
  265.   
  266. ***************
  267. *** 137,143 ****
  268. --- 137,156 ----
  269.       }
  270.   }
  271.   
  272. + unsigned short BCD(int binval)
  273. + {
  274. +   unsigned short tmp1, tmp2;
  275. +   /* bit 2 of register 0xb set=binary mode, clear=BCD mode */
  276. +   if (cmos.subst[0xb] & 4) return binval;
  277. +   if (binval > 99) binval = 99;
  278.   
  279. +   tmp1=binval / 10;
  280. +   tmp2=binval % 10;
  281. +   return ((tmp1 << 4) | tmp2);
  282. + }
  283.   int cmos_date(int reg)
  284.   {
  285.     unsigned long ticks;
  286. ***************
  287. *** 144,149 ****
  288. --- 157,163 ----
  289.     struct timeval tp;
  290.     struct timezone tzp;
  291.     struct tm *tm;
  292. +   int tmp;
  293.   
  294.     /* get the time */
  295.     gettimeofday(&tp, &tzp);
  296. ***************
  297. *** 155,179 ****
  298.     h_printf("CMOS: get date %d.%d.%d\n", tm->tm_mday, tm->tm_mon, tm->tm_year);
  299.   #endif
  300.   
  301. -   /* is any of this correct?? */
  302.     switch(reg)
  303.       {
  304.       case 0:  /* RTC seconds */
  305. !       return tm->tm_sec;
  306.       case 2:  /* RTC minutes */
  307. !       return tm->tm_min;
  308. !     case 4:  /* RTC hour */
  309. !       return tm->tm_hour;
  310.       case 6:  /* RTC weekday */
  311. !       return tm->tm_wday;
  312.       case 7:  /* RTC day of month */
  313. !       return tm->tm_mday; /* day of month */
  314.       case 8: /* RTC month */
  315.         if (cmos.flag[8]) return cmos.subst[8];
  316. !       else return tm->tm_mon;
  317.       case 9: /* RTC year */
  318.         if (cmos.flag[9]) return cmos.subst[9];
  319. !       else return tm->tm_year;
  320.       default:
  321.         h_printf("CMOS: cmos_time() register 0x%02x defaulted to 0\n",reg);
  322.         return 0;
  323. --- 169,198 ----
  324.     h_printf("CMOS: get date %d.%d.%d\n", tm->tm_mday, tm->tm_mon, tm->tm_year);
  325.   #endif
  326.   
  327.     switch(reg)
  328.       {
  329.       case 0:  /* RTC seconds */
  330. !       return BCD(tm->tm_sec);
  331.       case 2:  /* RTC minutes */
  332. !       return BCD(tm->tm_min);
  333. !     case 4:  /* RTC hour...bit 1 of 0xb set=24 hour mode, clear 12 hour */
  334. !       tmp=BCD(tm->tm_hour);
  335. !       if (cmos.subst[0xb]&2) return tmp;
  336. !       else {
  337. !     if (tmp == 0) return 12;
  338. !     else if (tmp > 12) return tmp-12;
  339. !       }
  340. !       break;
  341.       case 6:  /* RTC weekday */
  342. !       return BCD(tm->tm_wday);
  343.       case 7:  /* RTC day of month */
  344. !       return BCD(tm->tm_mday);
  345.       case 8: /* RTC month */
  346.         if (cmos.flag[8]) return cmos.subst[8];
  347. !       else return BCD(tm->tm_mon);
  348.       case 9: /* RTC year */
  349.         if (cmos.flag[9]) return cmos.subst[9];
  350. !       else return BCD(tm->tm_year);
  351.       default:
  352.         h_printf("CMOS: cmos_time() register 0x%02x defaulted to 0\n",reg);
  353.         return 0;
  354. ***************
  355. *** 191,193 ****
  356. --- 210,213 ----
  357.   }
  358.   
  359.   #undef CMOS_C
  360. diff +context dosemu0.48/cmos.h dosemu0.48p1/cmos.h
  361. *** dosemu0.48/cmos.h    Thu Feb 18 19:28:04 1993
  362. --- dosemu0.48p1/cmos.h    Thu Feb 18 19:12:14 1993
  363. ***************
  364. *** 21,23 ****
  365. --- 21,24 ----
  366.   };
  367.   
  368.   #endif
  369. diff +context dosemu0.48/disks.c dosemu0.48p1/disks.c
  370. *** dosemu0.48/disks.c    Thu Feb 18 19:28:03 1993
  371. --- dosemu0.48p1/disks.c    Thu Feb 18 19:12:14 1993
  372. ***************
  373. *** 106,108 ****
  374. --- 106,109 ----
  375.   /*                    ^ cylinders            */
  376.   /***********************************************************************/
  377.   #undef DISKS_C
  378. diff +context dosemu0.48/dos.c dosemu0.48p1/dos.c
  379. *** dosemu0.48/dos.c    Thu Feb 18 19:28:03 1993
  380. --- dosemu0.48p1/dos.c    Thu Feb 18 19:12:14 1993
  381. ***************
  382. *** 1,12 ****
  383.   /* dos emulator, Matthias Lautner */
  384.   /* Extensions by Robert Sanders, 1992-93
  385.    *
  386. !  * $Date: 1993/02/05 02:54:02 $
  387.    * $Source: /usr/src/dos/RCS/dos.c,v $
  388. !  * $Revision: 1.5 $
  389.    * $State: Exp $
  390.    *
  391.    * $Log: dos.c,v $
  392.    * Revision 1.5  1993/02/05  02:54:02  root
  393.    * this is for 0.47.6
  394.    *
  395. --- 1,16 ----
  396.   /* dos emulator, Matthias Lautner */
  397.   /* Extensions by Robert Sanders, 1992-93
  398.    *
  399. !  * $Date: 1993/02/18 18:53:41 $
  400.    * $Source: /usr/src/dos/RCS/dos.c,v $
  401. !  * $Revision: 1.6 $
  402.    * $State: Exp $
  403.    *
  404.    * $Log: dos.c,v $
  405. +  * Revision 1.6  1993/02/18  18:53:41  root
  406. +  * this is for 0.48patch1, mainly to fix the XMS bug (moved libemu up to
  407. +  * the 1 GB mark), and to try out the faster termcap buffer-compare code.
  408. +  *
  409.    * Revision 1.5  1993/02/05  02:54:02  root
  410.    * this is for 0.47.6
  411.    *
  412. ***************
  413. *** 23,41 ****
  414.    * One day I should look into this, but for now, we'll just deal with
  415.    * the interruptions.
  416.    *
  417. -  * Revision 1.2  1993/01/11  21:26:48  root
  418. -  * just put some comments in.
  419. -  *
  420.    */
  421.   
  422.   #include <stdio.h>
  423.   
  424. - #define LIBSTART     0x400000
  425.   void (*dosemu)();
  426.   char dummy[1088*1024 + 64*1024]; /* ensure that the lower 1MB+64K is unused */
  427.   
  428. ! /* the "+ 64*1024" reserves 64k second video buffer */
  429.   
  430.   int main(int argc, char **argv)
  431.   {
  432. --- 27,41 ----
  433.    * One day I should look into this, but for now, we'll just deal with
  434.    * the interruptions.
  435.    *
  436.    */
  437.   
  438.   #include <stdio.h>
  439.   
  440.   void (*dosemu)();
  441.   char dummy[1088*1024 + 64*1024]; /* ensure that the lower 1MB+64K is unused */
  442.   
  443. ! /* the "+ 64*1024" reserves 64k second video buffer...should be moved into
  444. !  * a simple malloc()ed global variable.  dunno why I did it this way */
  445.   
  446.   int main(int argc, char **argv)
  447.   {
  448. ***************
  449. *** 46,48 ****
  450. --- 46,49 ----
  451.     dosemu = (void *) LIBSTART;
  452.     dosemu(argc, argv);
  453.   }
  454. diff +context dosemu0.48/dosvga.c dosemu0.48p1/dosvga.c
  455. *** dosemu0.48/dosvga.c    Thu Feb 18 19:28:03 1993
  456. --- dosemu0.48p1/dosvga.c    Thu Feb 18 19:12:14 1993
  457. ***************
  458. *** 1544,1546 ****
  459. --- 1544,1547 ----
  460.   
  461.     vga_setmode(mode);
  462.   }
  463. diff +context dosemu0.48/dosvga.h dosemu0.48p1/dosvga.h
  464. *** dosemu0.48/dosvga.h    Thu Feb 18 19:28:04 1993
  465. --- dosemu0.48p1/dosvga.h    Thu Feb 18 19:12:14 1993
  466. ***************
  467. *** 54,56 ****
  468. --- 54,57 ----
  469.   
  470.   #endif /* VGA_H */
  471.   
  472. diff +context dosemu0.48/emu.c dosemu0.48p1/emu.c
  473. *** dosemu0.48/emu.c    Thu Feb 18 19:28:04 1993
  474. --- dosemu0.48p1/emu.c    Thu Feb 18 19:12:14 1993
  475. ***************
  476. *** 2,10 ****
  477.   #define EMU_C 1
  478.   /* Extensions by Robert Sanders, 1992-93
  479.    *
  480. !  * $Date: 1993/02/16 00:21:29 $
  481.    * $Source: /usr/src/dos/RCS/emu.c,v $
  482. !  * $Revision: 1.18 $
  483.    * $State: Exp $
  484.    *
  485.    * Revision 1.11  1993/01/25  22:59:38  root
  486. --- 2,10 ----
  487.   #define EMU_C 1
  488.   /* Extensions by Robert Sanders, 1992-93
  489.    *
  490. !  * $Date: 1993/02/18 18:53:41 $
  491.    * $Source: /usr/src/dos/RCS/emu.c,v $
  492. !  * $Revision: 1.19 $
  493.    * $State: Exp $
  494.    *
  495.    * Revision 1.11  1993/01/25  22:59:38  root
  496. ***************
  497. *** 69,74 ****
  498. --- 69,75 ----
  499.               *outp++ = (c);
  500.   #define CHFLUSH    if (outp > outbuf) { v_write(2, outbuf, outp - outbuf); \
  501.                           outp = outbuf; }
  502.   #define SETIVEC(i, seg, ofs)    ((us *)0)[ (i<<1) +1] = (us)seg; \
  503.                   ((us *)0)[  i<<1    ] = (us)ofs
  504.   
  505. ***************
  506. *** 94,100 ****
  507.   unsigned char outbuf[OUTBUFSIZE], *outp = outbuf;
  508.   int iflag;
  509.   int hdiskboot =0;
  510. ! int scrtest_bitmap;
  511.   long start_time;
  512.   unsigned long last_ticks;
  513.   int screen, xpos[8], ypos[8];
  514. --- 95,104 ----
  515.   unsigned char outbuf[OUTBUFSIZE], *outp = outbuf;
  516.   int iflag;
  517.   int hdiskboot =0;
  518. ! int scrtest_bitmap, update_screen;
  519. ! unsigned char *scrbuf;  /* the previously updated screen */
  520.   long start_time;
  521.   unsigned long last_ticks;
  522.   int screen, xpos[8], ypos[8];
  523. ***************
  524. *** 297,304 ****
  525.   int dostputs(char *a, int b, outfuntype c)
  526.   {
  527.     /* discard c right now */
  528. !   CHFLUSH;
  529. !   tputs(a,b,outc);
  530.   }
  531.   
  532.   void poscur(int x, int y)
  533. --- 301,309 ----
  534.   int dostputs(char *a, int b, outfuntype c)
  535.   {
  536.     /* discard c right now */
  537. ! /*  CHFLUSH; */
  538. ! /* was "CHFLUSH; tputs(a,b,outcbuf);" */
  539. !   tputs(a,b,c);
  540.   }
  541.   
  542.   void poscur(int x, int y)
  543. ***************
  544. *** 312,322 ****
  545.       int dx, dy, x, y, ofs;
  546.       us *sadr, *p, *q, blank = ' ' | (att << 8);
  547.   
  548.       if(l==0)        /* Wipe mode */
  549.       {
  550.           sadr=SCREEN_ADR(screen);
  551. - /*        must_update=1; */
  552.           for(dy=y0;dy<=y1;dy++)
  553.               for(dx=x0;dx<=x1;dx++)
  554.                   sadr[dy*CO+dx]=blank;
  555. --- 317,325 ----
  556. ***************
  557. *** 325,330 ****
  558. --- 328,334 ----
  559.   
  560.       sadr = SCREEN_ADR(screen);
  561.       sadr += x0 + CO * (y0 + l);
  562.       dx = x1 - x0 +1;
  563.       dy = y1 - y0 - l +1;
  564.       ofs = -CO * l;
  565. ***************
  566. *** 339,344 ****
  567. --- 343,350 ----
  568.           p = sadr;
  569.           for (x=0; x<dx; x++, p++) *p = blank;
  570.       }
  571. +     update_screen=1; 
  572.   }
  573.   
  574.   void scrolldn(int x0, int y0 , int x1, int y1, int l, int att)
  575. ***************
  576. *** 349,359 ****
  577.       if(l==0)
  578.       {
  579.           l=LI-1;        /* Clear whole if l=0 */
  580. - /*        must_update=1; */
  581.       }
  582.   
  583.       sadr = SCREEN_ADR(screen);
  584.       sadr += x0 + CO * (y1 -l);
  585.       dx = x1 - x0 +1;
  586.       dy = y1 - y0 - l +1;
  587.       ofs = CO * l;
  588. --- 355,365 ----
  589.       if(l==0)
  590.       {
  591.           l=LI-1;        /* Clear whole if l=0 */
  592.       }
  593.   
  594.       sadr = SCREEN_ADR(screen);
  595.       sadr += x0 + CO * (y1 -l);
  596.       dx = x1 - x0 +1;
  597.       dy = y1 - y0 - l +1;
  598.       ofs = CO * l;
  599. ***************
  600. *** 368,373 ****
  601. --- 374,381 ----
  602.           p = sadr;
  603.           for (x=0; x<dx; x++, p++) *p = blank;
  604.       }
  605. +     update_screen=1; 
  606.   }
  607.   
  608.   v_write(int fd, unsigned char *ch, int len)
  609. ***************
  610. *** 391,398 ****
  611.             xpos[s] = 0;
  612.           } else if (ch == '\n') {
  613.             ypos[s]++;
  614. !           /* is this correct? EDLIN needs it */
  615. !           xpos[s]=0;
  616.           } else if (ch == '\010' && xpos[s] > 0) {
  617.             xpos[s]--;
  618.           } else if (ch == '\t') {
  619. --- 399,405 ----
  620.             xpos[s] = 0;
  621.           } else if (ch == '\n') {
  622.             ypos[s]++;
  623. !           xpos[s]=0;  /* EDLIN needs this behavior */
  624.           } else if (ch == '\010' && xpos[s] > 0) {
  625.             xpos[s]--;
  626.           } else if (ch == '\t') {
  627. ***************
  628. *** 406,414 ****
  629.         }
  630.   
  631.       else {
  632.         if (ch >= ' ') {
  633.           sadr = SCREEN_ADR(s);
  634. !         sadr[ypos[s]*CO + xpos[s]++] = ch | (7 << 8);
  635.           if (s == screen) outc(trans[ch]);
  636.         } else if (ch == '\r') {
  637.           xpos[s] = 0;
  638. --- 413,431 ----
  639.         }
  640.   
  641.       else {
  642. +       unsigned short *wscrbuf=(unsigned short *)scrbuf;
  643. +       /* update_screen not set to 1 because we do the outputting
  644. +        * ourselves...scrollup() and scrolldn() should also work
  645. +        * this way, when I get around to it.
  646. +        */
  647. + /*      update_screen=1; */
  648.         if (ch >= ' ') {
  649.           sadr = SCREEN_ADR(s);
  650. !         sadr[ypos[s]*CO + xpos[s]] = ch | (att << 8);
  651. !         wscrbuf[ypos[s]*CO + xpos[s]] = ch | (att << 8); 
  652. !         xpos[s]++;
  653.           if (s == screen) outc(trans[ch]);
  654.         } else if (ch == '\r') {
  655.           xpos[s] = 0;
  656. ***************
  657. *** 415,420 ****
  658. --- 432,438 ----
  659.           if (s == screen) write(2, &ch, 1);
  660.         } else if (ch == '\n') {
  661.           ypos[s]++;
  662. +         xpos[s]=0;  /* EDLIN needs this behavior */
  663.           if (s == screen) write(2, &ch, 1);
  664.         } else if (ch == '\010' && xpos[s] > 0) {
  665.           xpos[s]--;
  666. ***************
  667. *** 447,458 ****
  668.       int lx, ly;
  669.   
  670.       if (s > max_page) return;
  671.       if (!console_video)
  672.         if (s == screen) tputs(cl, 1, outc);
  673.       xpos[s] = ypos[s] = 0;
  674.       poscur(0,0);
  675. !     sadr = SCREEN_ADR(s);
  676. !     for (p = sadr; p < sadr+2000; *p++ = blank);
  677.   }
  678.   
  679.   void restore_screen(void)
  680. --- 465,477 ----
  681.       int lx, ly;
  682.   
  683.       if (s > max_page) return;
  684. +     sadr = SCREEN_ADR(s);
  685. +     for (p = sadr; p < sadr+2000; *p++ = blank);
  686.       if (!console_video)
  687.         if (s == screen) tputs(cl, 1, outc);
  688.       xpos[s] = ypos[s] = 0;
  689.       poscur(0,0);
  690. !     update_screen=1; 
  691.   }
  692.   
  693.   void restore_screen(void)
  694. ***************
  695. *** 461,468 ****
  696.       unsigned char c, a;
  697.       int x, y, oa;
  698.   
  699. !     v_printf("RESTORE SCREEN\n");
  700.   
  701.       if (console_video) {
  702.         v_printf("restore cancelled for console_video\n");
  703.         return;
  704. --- 480,489 ----
  705.       unsigned char c, a;
  706.       int x, y, oa;
  707.   
  708. !     update_screen=0;
  709.   
  710. +     v_printf("RESTORE SCREEN: scrbuf at 0x%08x\n", scrbuf);
  711.       if (console_video) {
  712.         v_printf("restore cancelled for console_video\n");
  713.         return;
  714. ***************
  715. *** 472,477 ****
  716. --- 493,509 ----
  717.       oa = 7; 
  718.       p = sadr;
  719.       for (y=0; y<LI; y++) {
  720. +       /* only update if line has changed..note that sadr is an unsigned
  721. +        * short ptr, so CO is not multiplied by 2...I'll clean this up
  722. +        * later.
  723. +        */
  724. +       if (! memcmp(scrbuf+y*CO*2,sadr+y*CO,CO*2) )
  725. +         {
  726. +           p+=CO;  /* p is an unsigned short pointer */
  727. +           continue; 
  728. +         }
  729. +       else memcpy(scrbuf+y*CO*2,p,CO*2);  /* scrbuf is a char ptr */
  730.           dostputs(tgoto(cm, 0, y), 1, outcbuf);
  731.           for (x=0; x<CO; x++) {
  732.               c = *(unsigned char *)p;
  733. ***************
  734. *** 953,959 ****
  735.     *(char *)0xd0000=0x09;
  736.     *(char *)0xd0001=0x00;    /* 9 byte table */
  737.     *(char *)0xd0002=0xFC;        /* PC AT */
  738. !   *(char *)0xd0003=0x00;
  739.     *(char *)0xd0004=0x04;    /* bios revision 4 */
  740.     *(char *)0xd0005=0x20;    /* no mca no ebios no wat no keybint
  741.                      rtc no slave 8259 no dma 3 */
  742. --- 985,991 ----
  743.     *(char *)0xd0000=0x09;
  744.     *(char *)0xd0001=0x00;    /* 9 byte table */
  745.     *(char *)0xd0002=0xFC;        /* PC AT */
  746. !   *(char *)0xd0003=0x01;
  747.     *(char *)0xd0004=0x04;    /* bios revision 4 */
  748.     *(char *)0xd0005=0x20;    /* no mca no ebios no wat no keybint
  749.                      rtc no slave 8259 no dma 3 */
  750. ***************
  751. *** 1189,1194 ****
  752. --- 1221,1227 ----
  753.       {
  754.         scrtest_bitmap = 1 << (24 + screen);
  755.         vm86s.screen_bitmap = -1;
  756. +       update_screen=1;
  757.       }
  758.         return;
  759.       }
  760. ***************
  761. *** 1839,1847 ****
  762.       CARRY;
  763.       return;
  764.     case 0xc0:
  765. !     g_printf("incomplete EXT. BIOS DATA AREA requested...\n");
  766. !     _regs.es=0xd000;
  767. !     _regs.ebx=0x0000;    /* bios data area - see emulate.. */
  768.       return;
  769.     case 0xc1:
  770.       CARRY;
  771. --- 1872,1887 ----
  772.       CARRY;
  773.       return;
  774.     case 0xc0:
  775. !     g_printf("Return system config parameters (int 15h, AH=0xc0)\n");
  776. !     if (mapped_bios)
  777. !       {
  778. !     _regs.es=0xf000;
  779. !     _regs.ebx=0xe6f5;
  780. !       }
  781. !     else {
  782. !       _regs.es=0xd000;
  783. !       _regs.ebx=0x0000;    /* bios data area - see emulate.. */
  784. !     }
  785.       return;
  786.     case 0xc1:
  787.       CARRY;
  788. ***************
  789. *** 2531,2537 ****
  790.       inalrm=1;
  791.       in_sighandler=1;
  792.   
  793. !     if ((vm86s.screen_bitmap & scrtest_bitmap) && !running) {
  794.         running = 1;
  795.         restore_screen();
  796.         vm86s.screen_bitmap = 0;
  797. --- 2571,2578 ----
  798.       inalrm=1;
  799.       in_sighandler=1;
  800.   
  801. !     if ( ((vm86s.screen_bitmap & scrtest_bitmap) || 
  802. !       (update_screen && !console_video)) && !running) {
  803.         running = 1;
  804.         restore_screen();
  805.         vm86s.screen_bitmap = 0;
  806. ***************
  807. *** 2539,2545 ****
  808.         running = 0;
  809.       }
  810.   
  811. !     if (console_keyb && poll_io && !in_readkeyboard) 
  812.         {
  813.       if (in_ioctl)
  814.         k_printf("not polling keyboard: in_ioctl: %d %04x %04x\n",
  815. --- 2580,2586 ----
  816.         running = 0;
  817.       }
  818.   
  819. !     if (poll_io && !in_readkeyboard) 
  820.         {
  821.       if (in_ioctl)
  822.         k_printf("not polling keyboard: in_ioctl: %d %04x %04x\n",
  823. ***************
  824. *** 3013,3018 ****
  825. --- 3054,3063 ----
  826.       mapped_bios=0;
  827.       keybint=0; 
  828.   
  829. +     /* allocate screen buffer for non-console video compare speedup */
  830. +     scrbuf=malloc(CO*LI*2);
  831. +     v_printf("VID: malloc'ed scrbuf at 0x%08x\n", scrbuf);
  832.       opterr=0;
  833.       while ( (c=getopt(argc, argv, "ABCfckm:D:pP:bH:F:VNtsgxK")) != EOF) {
  834.         switch(c) {
  835. ***************
  836. *** 3147,3154 ****
  837.       termioInit();
  838.       hardware_init();
  839.       clear_screen(screen, 7);
  840. !     dbug_printf("$Header: /usr/src/dos/RCS/emu.c,v 1.18 1993/02/16 00:21:29 root Exp $\n");
  841. !     p_dos_str("Linux DOS emulator $Revision: 1.18 $  1993\n\r");
  842.       p_dos_str("Mods by Robert Sanders, Alan Cox\n\r");
  843.       if (hdiskboot != 2)
  844.         boot(hdiskboot? hdisktab : disktab); 
  845. --- 3192,3199 ----
  846.       termioInit();
  847.       hardware_init();
  848.       clear_screen(screen, 7);
  849. !     dbug_printf("$Header: /usr/src/dos/RCS/emu.c,v 1.19 1993/02/18 18:53:41 root Exp $\n");
  850. !     p_dos_str("Linux DOS emulator $Revision: 1.19 $  1993\n\r");
  851.       p_dos_str("Mods by Robert Sanders, Alan Cox\n\r");
  852.       if (hdiskboot != 2)
  853.         boot(hdiskboot? hdisktab : disktab); 
  854. ***************
  855. *** 3166,3171 ****
  856. --- 3211,3217 ----
  857.         vm86s.flags = 0;
  858.       vm86s.screen_bitmap = 0;
  859.       scrtest_bitmap = 1 << (24 + screen);
  860. +     update_screen=1;
  861.   
  862.       for(;!error;) {
  863.         run_vm86();
  864. ***************
  865. *** 3328,3334 ****
  866.   
  867.   void usage(void)
  868.   {
  869. !    fprintf(stderr, "$Header: /usr/src/dos/RCS/emu.c,v 1.18 1993/02/16 00:21:29 root Exp $\n");
  870.      fprintf(stderr,"usage: dos [-ABCfckbVtspgxK] [-D flags] [-m SIZE] [-P FILE] [-H|F #disks] > doserr\n");
  871.      fprintf(stderr,"    -A boot from first defined floppy disk (A)\n");
  872.      fprintf(stderr,"    -B boot from second defined floppy disk (B) (#)\n");
  873. --- 3374,3380 ----
  874.   
  875.   void usage(void)
  876.   {
  877. !    fprintf(stderr, "$Header: /usr/src/dos/RCS/emu.c,v 1.19 1993/02/18 18:53:41 root Exp $\n");
  878.      fprintf(stderr,"usage: dos [-ABCfckbVtspgxK] [-D flags] [-m SIZE] [-P FILE] [-H|F #disks] > doserr\n");
  879.      fprintf(stderr,"    -A boot from first defined floppy disk (A)\n");
  880.      fprintf(stderr,"    -B boot from second defined floppy disk (B) (#)\n");
  881. ***************
  882. *** 3386,3388 ****
  883. --- 3432,3435 ----
  884.   }
  885.   
  886.   #undef EMU_C
  887. diff +context dosemu0.48/emu.h dosemu0.48p1/emu.h
  888. *** dosemu0.48/emu.h    Thu Feb 18 19:28:03 1993
  889. --- dosemu0.48p1/emu.h    Thu Feb 18 19:12:14 1993
  890. ***************
  891. *** 195,197 ****
  892. --- 195,198 ----
  893.   
  894.   static char RCSid[]="$Header: /usr/src/dos/RCS/emu.h,v 1.8 1993/02/13 23:37:20 root Exp $";
  895.   #endif /* EMU_H */
  896. diff +context dosemu0.48/keymaps.c dosemu0.48p1/keymaps.c
  897. *** dosemu0.48/keymaps.c    Thu Feb 18 19:28:04 1993
  898. --- dosemu0.48p1/keymaps.c    Thu Feb 18 19:12:14 1993
  899. ***************
  900. *** 756,758 ****
  901. --- 756,759 ----
  902.   #else
  903.   CONST unsigned char num_table[] = "789-456+1230,";
  904.   #endif
  905. diff +context dosemu0.48/linuxfs.c dosemu0.48p1/linuxfs.c
  906. *** dosemu0.48/linuxfs.c    Thu Feb 18 19:28:04 1993
  907. --- dosemu0.48p1/linuxfs.c    Thu Feb 18 19:12:14 1993
  908. ***************
  909. *** 340,342 ****
  910. --- 340,343 ----
  911.       }
  912.       return -1;
  913.   }
  914. diff +context dosemu0.48/termio.c dosemu0.48p1/termio.c
  915. *** dosemu0.48/termio.c    Thu Feb 18 19:28:03 1993
  916. --- dosemu0.48p1/termio.c    Thu Feb 18 19:12:14 1993
  917. ***************
  918. *** 2,10 ****
  919.   #define TERMIO_C 1
  920.   /* Extensions by Robert Sanders, 1992-93
  921.    *
  922. !  * $Date: 1993/02/16 00:21:29 $
  923.    * $Source: /usr/src/dos/RCS/termio.c,v $
  924. !  * $Revision: 1.17 $
  925.    * $State: Exp $
  926.    */
  927.   
  928. --- 2,10 ----
  929.   #define TERMIO_C 1
  930.   /* Extensions by Robert Sanders, 1992-93
  931.    *
  932. !  * $Date: 1993/02/18 18:53:41 $
  933.    * $Source: /usr/src/dos/RCS/termio.c,v $
  934. !  * $Revision: 1.19 $
  935.    * $State: Exp $
  936.    */
  937.   
  938. ***************
  939. *** 454,460 ****
  940.           ioctl(kbd_fd, VT_ACTIVATE, other_no);
  941.           ioctl(kbd_fd, VT_ACTIVATE, console_no);
  942.         }
  943. !     dbug_printf("$Header: /usr/src/dos/RCS/termio.c,v 1.17 1993/02/16 00:21:29 root Exp $\n");
  944.       return 0;
  945.   }
  946.   
  947. --- 454,460 ----
  948.           ioctl(kbd_fd, VT_ACTIVATE, other_no);
  949.           ioctl(kbd_fd, VT_ACTIVATE, console_no);
  950.         }
  951. !     dbug_printf("$Header: /usr/src/dos/RCS/termio.c,v 1.19 1993/02/18 18:53:41 root Exp $\n");
  952.       return 0;
  953.   }
  954.   
  955. ***************
  956. *** 707,712 ****
  957. --- 707,716 ----
  958.   
  959.   open_kmem()
  960.   {
  961. +     /* as I understad it, /dev/kmem is the kernel's view of memory,
  962. +      * and /dev/mem is the identity-mapped (i.e. physical addressed)
  963. +      * memory. Currently under Linux, both are the same.
  964. +      */
  965.       if ((mem_fd = open("/dev/mem", O_RDWR) ) < 0) {
  966.       error("ERROR: can't open /dev/mem \n");
  967.       return (-1);
  968. ***************
  969. *** 1533,1539 ****
  970.       put_queue(ctrl_cursor[sc]);
  971.     else if (kbd_flag(KF_NUMLOCK) || kbd_flag(KF_LSHIFT)
  972.         || kbd_flag(KF_RSHIFT)) 
  973. !     put_queue(num_table[sc]);
  974.     else
  975.       put_queue(old_sc << 8);
  976.   }
  977. --- 1537,1543 ----
  978.       put_queue(ctrl_cursor[sc]);
  979.     else if (kbd_flag(KF_NUMLOCK) || kbd_flag(KF_LSHIFT)
  980.         || kbd_flag(KF_RSHIFT)) 
  981. !     put_queue((old_sc << 8) | num_table[sc]);
  982.     else
  983.       put_queue(old_sc << 8);
  984.   }
  985. ***************
  986. *** 1562,1576 ****
  987.   
  988.   static void func(unsigned int sc)
  989.   {
  990. ! /* should be pretty close to perfect 
  991. !  * is the precedence right ? */
  992.   
  993. -   static int fkey_table[]=
  994. -     {
  995. -       0x3b, 0x3c, 0x3d, 0x3e, 0x41, 0x3f,
  996. -       0x40, 0x42, 0x43, 0x44, 0x57, 0x58 
  997. -     };
  998.     /* this checks for the VC-switch key sequence */
  999.     if (kbd_flag(EKF_LALT) && !kbd_flag(EKF_RALT) && !kbd_flag(KF_RSHIFT)
  1000.         && !kbd_flag(KF_LSHIFT) && !kbd_flag(KF_CTRL))
  1001. --- 1566,1574 ----
  1002.   
  1003.   static void func(unsigned int sc)
  1004.   {
  1005. !   int fnum=sc-0x3a;
  1006. !   if (fnum > 10) fnum -= 0x12;   /* adjust if f11 or f12 */
  1007.   
  1008.     /* this checks for the VC-switch key sequence */
  1009.     if (kbd_flag(EKF_LALT) && !kbd_flag(EKF_RALT) && !kbd_flag(KF_RSHIFT)
  1010.         && !kbd_flag(KF_LSHIFT) && !kbd_flag(KF_CTRL))
  1011. ***************
  1012. *** 1583,1603 ****
  1013.          * been called from a signal handler, and ioctl() is not reentrant.
  1014.          * hence the delay until out of the signal handler...
  1015.          */
  1016. !       activate(sc-0x3a);
  1017.         return;
  1018.       }
  1019.   
  1020.     if (kbd_flag(KF_LSHIFT) || kbd_flag(KF_RSHIFT))
  1021. !     put_queue((sc + 0x19) << 8);
  1022.     else if (kbd_flag(KF_CTRL))
  1023. !     put_queue((sc + 0x23) << 8);
  1024.     else if (kbd_flag(KF_ALT))
  1025. !     put_queue((sc + 0x2d) << 8);
  1026.     else
  1027. !     put_queue(sc << 8);
  1028.   }
  1029.   
  1030.   int activate(int con_num)
  1031.   {
  1032.     if (in_ioctl)
  1033. --- 1581,1610 ----
  1034.          * been called from a signal handler, and ioctl() is not reentrant.
  1035.          * hence the delay until out of the signal handler...
  1036.          */
  1037. !       activate(fnum);
  1038.         return;
  1039.       }
  1040.   
  1041. + /* FCH (Fkey CHoose):   returns a if n is f11 or f12, else it returns b
  1042. +  * PC scancodes for fkeys are "orthogonal" except F11 and F12.
  1043. +  */
  1044. + #define FCH(n,a,b) ((n <= 10) ? a : b)
  1045.     if (kbd_flag(KF_LSHIFT) || kbd_flag(KF_RSHIFT))
  1046. !     put_queue( (sc + FCH(fnum,0x19,0x30)) << 8);
  1047.     else if (kbd_flag(KF_CTRL))
  1048. !     put_queue( (sc + FCH(fnum,0x23,0x32)) << 8);
  1049.     else if (kbd_flag(KF_ALT))
  1050. !     put_queue( (sc + FCH(fnum,0x2d,0x34)) << 8);
  1051.     else
  1052. !     put_queue( FCH(fnum,sc,sc+0x2e) << 8);
  1053.   }
  1054.   
  1055.   int activate(int con_num)
  1056.   {
  1057.     if (in_ioctl)
  1058. ***************
  1059. *** 1762,1764 ****
  1060. --- 1769,1772 ----
  1061.   }
  1062.   /************* end of key-related functions *************/
  1063.   #undef TERMIO_C
  1064. diff +context dosemu0.48/termio.h dosemu0.48p1/termio.h
  1065. *** dosemu0.48/termio.h    Thu Feb 18 19:28:03 1993
  1066. --- dosemu0.48p1/termio.h    Thu Feb 18 19:12:14 1993
  1067. ***************
  1068. *** 107,109 ****
  1069. --- 107,110 ----
  1070.   #define SCRN_BUF_SIZE    (0x10000)    /* buffer of 64K */
  1071.   
  1072.   #endif /* TERMIO_H */
  1073. diff +context dosemu0.48/timers.c dosemu0.48p1/timers.c
  1074. *** dosemu0.48/timers.c    Thu Feb 18 19:28:03 1993
  1075. --- dosemu0.48p1/timers.c    Thu Feb 18 19:12:14 1993
  1076. ***************
  1077. *** 50,52 ****
  1078. --- 50,53 ----
  1079.     warn("TIMER: update value of %d\n", (40 / (1000000 / UPDATE)));
  1080.   }
  1081.   #undef TIMERS_C
  1082. diff +context dosemu0.48/timers.h dosemu0.48p1/timers.h
  1083. *** dosemu0.48/timers.h    Thu Feb 18 19:28:04 1993
  1084. --- dosemu0.48p1/timers.h    Thu Feb 18 19:12:14 1993
  1085. ***************
  1086. *** 33,35 ****
  1087. --- 33,36 ----
  1088.                         * is called */
  1089.   
  1090.   #endif /* TIMERS_H */
  1091. diff +context dosemu0.48/xms.c dosemu0.48p1/xms.c
  1092. *** dosemu0.48/xms.c    Thu Feb 18 19:28:03 1993
  1093. --- dosemu0.48p1/xms.c    Thu Feb 18 19:12:14 1993
  1094. ***************
  1095. *** 1,21 ****
  1096.   /* xms.c for the DOS emulator 
  1097.    *       Robert Sanders, gt8134b@prism.gatech.edu
  1098.    *
  1099. !  * $Date: 1993/02/16 00:21:29 $
  1100.    * $Source: /usr/src/dos/RCS/xms.c,v $
  1101. !  * $Revision: 1.3 $
  1102.    * $State: Exp $
  1103.    *
  1104.    * $Log: xms.c,v $
  1105.    * Revision 1.3  1993/02/16  00:21:29  root
  1106.    * DOSEMU 0.48 DISTRIBUTION
  1107.    *
  1108. -  * Revision 1.2  1993/02/13  23:37:20  root
  1109. -  * latest version, no time to document!
  1110. -  *
  1111. -  * Revision 1.1  1993/02/10  20:55:01  root
  1112. -  * Initial revision
  1113. -  *
  1114.    * NOTE: I keep the BYTE size of EMB's in a field called "size" in the EMB
  1115.    *    structure.  Most XMS calls specify/expect size in KILOBYTES.
  1116.    */
  1117. --- 1,19 ----
  1118.   /* xms.c for the DOS emulator 
  1119.    *       Robert Sanders, gt8134b@prism.gatech.edu
  1120.    *
  1121. !  * $Date: 1993/02/18 18:53:41 $
  1122.    * $Source: /usr/src/dos/RCS/xms.c,v $
  1123. !  * $Revision: 1.4 $
  1124.    * $State: Exp $
  1125.    *
  1126.    * $Log: xms.c,v $
  1127. +  * Revision 1.4  1993/02/18  18:53:41  root
  1128. +  * this is for 0.48patch1, mainly to fix the XMS bug (moved libemu up to
  1129. +  * the 1 GB mark), and to try out the faster termcap buffer-compare code.
  1130. +  *
  1131.    * Revision 1.3  1993/02/16  00:21:29  root
  1132.    * DOSEMU 0.48 DISTRIBUTION
  1133.    *
  1134.    * NOTE: I keep the BYTE size of EMB's in a field called "size" in the EMB
  1135.    *    structure.  Most XMS calls specify/expect size in KILOBYTES.
  1136.    */
  1137. ***************
  1138. *** 27,33 ****
  1139.   #include "emu.h"
  1140.   #include "xms.h"
  1141.   
  1142. ! static char RCSxms[]="$Header: /usr/src/dos/RCS/xms.c,v 1.3 1993/02/16 00:21:29 root Exp $";
  1143.   
  1144.   extern int xms, vga, graphics, mapped_bios;
  1145.   extern int extmem_size;
  1146. --- 25,39 ----
  1147.   #include "emu.h"
  1148.   #include "xms.h"
  1149.   
  1150. ! /* 128*1024 is the amount of memory currently reserved in dos.c above
  1151. !  * the 1 MEG mark.  ugly.  fix this.
  1152. !  */
  1153. ! #if (MAX_XMS*1024) >= (LIBSTART-1152*1024)
  1154. ! #error "Your MAX_XMS is too large...it would overstep into libemu. \
  1155. ! Try increasing LIBSTART in the Makefile, or better yet, decreasing MAX_XMS."
  1156. ! #endif
  1157. ! static char RCSxms[]="$Header: /usr/src/dos/RCS/xms.c,v 1.4 1993/02/18 18:53:41 root Exp $";
  1158.   
  1159.   extern int xms, vga, graphics, mapped_bios;
  1160.   extern int extmem_size;
  1161. ***************
  1162. *** 48,54 ****
  1163.   
  1164.   static struct Handle handles[NUM_HANDLES+1];
  1165.   static int    handle_count=0;
  1166. - static long   handle_mask=0;  /* 32 bits for 32 handles */
  1167.   
  1168.   static int xms_grab_int15=0;  /* non-version XMS call been made yet? */
  1169.   
  1170. --- 54,59 ----
  1171. ***************
  1172. *** 82,88 ****
  1173.     xms_grab_int15=0;
  1174.   
  1175.     handle_count=0;
  1176. -   handle_mask=0;
  1177.     for (i=0; i<NUM_HANDLES+1; i++)
  1178.         handles[i].valid=0;
  1179.   }
  1180. --- 87,92 ----
  1181. ***************
  1182. *** 113,119 ****
  1183.        x_printf("XMS request HMA size 0x%04x\n", WORD(_regs.edx));
  1184.        if (freeHMA)
  1185.          {
  1186. !          x_printf("XMS: allocating HMA\n");
  1187.            freeHMA=0;
  1188.            _regs.eax=1;
  1189.          }
  1190. --- 117,123 ----
  1191.        x_printf("XMS request HMA size 0x%04x\n", WORD(_regs.edx));
  1192.        if (freeHMA)
  1193.          {
  1194. !          x_printf("XMS: allocating HMA size 0x%04x\n", WORD(_regs.edx));
  1195.            freeHMA=0;
  1196.            _regs.eax=1;
  1197.          }
  1198. ***************
  1199. *** 271,277 ****
  1200.       }
  1201.   
  1202.     /* total free is max allowable XMS - the number of K already allocated */
  1203. !   _regs.eax = _regs.edx = MAX_XMS - (totalBytes / 1024);
  1204.   
  1205.     LO(bx)=0;  /* no error */
  1206.     x_printf("XMS query free memory: %dK %dK\n", _regs.eax, _regs.edx);
  1207. --- 275,281 ----
  1208.       }
  1209.   
  1210.     /* total free is max allowable XMS - the number of K already allocated */
  1211. !   _regs.eax = _regs.edx = extmem_size - (totalBytes / 1024);
  1212.   
  1213.     LO(bx)=0;  /* no error */
  1214.     x_printf("XMS query free memory: %dK %dK\n", _regs.eax, _regs.edx);
  1215. ***************
  1216. *** 299,305 ****
  1217.         }
  1218.         handles[h].lockcount=0;
  1219.         handle_count++;
  1220. -       handle_mask |= (1 << h);  /* set mask for handle */
  1221.   
  1222.         x_printf("XMS: allocated EMB %d at %08x\n", h, handles[h].addr);
  1223.   
  1224. --- 303,308 ----
  1225. ***************
  1226. *** 326,332 ****
  1227.               handles[h].size);
  1228.         handles[h].valid=0;
  1229.         handle_count--;
  1230. -       handle_mask &= ~(1 << h); /* clear handle bit */
  1231.   
  1232.         x_printf("XMS: free'd EMB %d\n", h);
  1233.         _regs.eax=1;
  1234. --- 329,334 ----
  1235. ***************
  1236. *** 620,622 ****
  1237. --- 622,625 ----
  1238.   }
  1239.   
  1240.   #undef XMS_C
  1241. diff +context dosemu0.48/xms.h dosemu0.48p1/xms.h
  1242. *** dosemu0.48/xms.h    Thu Feb 18 19:28:04 1993
  1243. --- dosemu0.48p1/xms.h    Thu Feb 18 19:12:14 1993
  1244. ***************
  1245. *** 9,17 ****
  1246.   
  1247.   #define XMS_MAGIC              0x0043
  1248.   #define XMS_VERSION            0x0300  /* version 3.00 */
  1249. ! #define XMS_DRIVER_VERSION    0x0002  /* my driver version 0.01 */
  1250.   
  1251. ! #define NUM_HANDLES     32
  1252.   #define FIRST_HANDLE    1
  1253.   
  1254.   #define PARAGRAPH       16        /* bytes in a paragraph */
  1255. --- 9,17 ----
  1256.   
  1257.   #define XMS_MAGIC              0x0043
  1258.   #define XMS_VERSION            0x0300  /* version 3.00 */
  1259. ! #define XMS_DRIVER_VERSION    0x0003  /* my driver version 0.03 */
  1260.   
  1261. ! #define NUM_HANDLES     64
  1262.   #define FIRST_HANDLE    1
  1263.   
  1264.   #define PARAGRAPH       16        /* bytes in a paragraph */
  1265. ***************
  1266. *** 42,44 ****
  1267. --- 42,45 ----
  1268.        xms_init(void);
  1269.   
  1270.   #endif /* XMS_H */
  1271.